package com.house.controller;

import com.house.entity.District;
import com.house.service.DistrictService;
import com.house.util.BaseResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController     //地址
@CrossOrigin(value = "*",allowCredentials ="true")
@RequestMapping("/district/")
public class DistrictController {
    @Autowired
    private DistrictService districtService;

    @RequestMapping("getDisrictData")
    public BaseResult getDisrictData(){
        List<District> allDistrict = this.districtService.getAllDistrict();
        return new BaseResult(200,allDistrict);
    }


}
